﻿using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Text;
using System.Data;
using MINERP.DAL;



namespace MINERP.BLL.LeaderOperate
{
    public  class LeaderTask
    {

        private MINERP.DAL.LeaderOperate.LeaderTask _dal = new  DAL.LeaderOperate.LeaderTask(); 
        //public DataTable GetTaskByleaderIdAndOper(int inLeaderId,Dictionary<int,string> inDic)
        //{
        //    ObjectQuery<WorkOrderFlowList> useableFlow = _dal.GetTaskByStatusAndOpe(inLeaderId, );
        //}

        /// <summary>
        /// 将操作转换为Entity可用格式
        /// </summary>
        /// <param name="inDic"></param>
        /// <returns></returns>
        private string changer(Dictionary<int, string> inDic)
        {
            string strVar = string.Empty;
            // string strTemp = string.Empty;
            string strRtn = string.Empty;
           
            foreach (var dic in inDic.Keys)
            {
                strVar = "," + dic.ToString();
            }
            if (strVar.StartsWith(","))
            {
                strVar = strVar.Substring(1);
            }
            strRtn = "{" + strVar + "}";
            if (strRtn.Equals("{}"))
                return "{0}";
            else
                return strRtn;
        }
        /// <summary>
        /// 创建组长产看任务列表
        /// </summary>
        /// <returns></returns>
        private DataTable CreateLeaderTaskTable()
        {
            DataTable table =new DataTable();

            table.Columns.Add(new DataColumn("OrderProductId", typeof (int)));
            table.Columns.Add(new DataColumn("BagCode", typeof (string)));
            table.Columns.Add(new DataColumn("BagName", typeof (string)));
            table.Columns.Add(new DataColumn("OrderProductCode", typeof (string)));
            table.Columns.Add(new DataColumn("OrderProductName", typeof (string)));
            
           
            table.Columns.Add(new DataColumn("ShopName", typeof (string)));
            table.Columns.Add(new DataColumn("CtmName", typeof (string)));
            table.Columns.Add(new DataColumn("TechName", typeof (string)));
            table.Columns.Add(new DataColumn("OrderPath", typeof (string)));
            table.Columns.Add(new DataColumn("UserName", typeof (string)));
            table.Columns.Add(new DataColumn("status", typeof(string)));
            table.Columns.Add(new DataColumn("OrderTime", typeof(DateTime)));
            table.Columns.Add(new DataColumn("AssignTime", typeof(DateTime)));
            table.Columns.Add(new DataColumn("CompletedTime", typeof(DateTime)));

            return table;
        }
    }

}
